package IC.lir.instructions;
import IC.lir.*;
import java.util.List;

import IC.lir.operands.Operand;
import IC.lir.operands.RegOperand;

/**
 * Library instruction <br>
 * <br>
 *  Library func-name(params) <br>
 * <br>
 * 'params' stands for:  <br>
 * 	Reg, Mem, Imm, label, String name <br>
 * 
 */
public class LibraryInstr extends Instruction {
	private String funcName;
	private List<? extends Operand> params;
	private RegOperand	dest;

	/**
	 * 
	 * @param funcName the name of the library function
	 * @param params function parameters
	 */
	public LibraryInstr(String funcName, List<? extends Operand> params,
			RegOperand	dest) {
		
		this.funcName = funcName;
		this.params = params;
		this.dest = dest;
	}
	
	/**
	 * @return the funcName
	 */
	public String getFuncName() {
		return funcName;
	}

	/**
	 * @return the params
	 */
	public List<? extends Operand> getParams() {
		return params;
	}

	/**
	 * @return the dest
	 */
	public RegOperand getDest() {
		return dest;
	}

	@Override
	public <D,U> U accept(Visitor<D,U> v, D context) {
		return v.visit(this,context);
	}
}
